
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

ll solve(ll a, ll b, ll c){ // ax^2 + bx + c = 0, a,b >= 0
    ll l = 0, r = 1e9;
    while(l < r){
        ll mid = (l + r + 1) / 2;
        if(a * mid * mid + b * mid + c <= 0) l = mid;
        else r = mid - 1;
    }
    if(a * l * l + b * l + c == 0) return l;
    return -1;
}

int main(){
    ll n;
    cin >> n;
    for(ll d = 1; d * d * d <= n; d++){
        if(n % d != 0) continue;
        ll y = solve(3, 3 * d, d * d - n / d);
        if(y > 0){
            cout << y + d << " " << y << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}